package com.itheima.controller;

import com.qiniu.util.Auth;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 黑马程序员
 * @Company http://www.ithiema.com
 * @Version 1.0
 */
@RestController
public class UploadController {

    @RequestMapping("/getToken")
    public String getToken(){
        String accessKey = "hdnR_QrCoEIvSvDxBt_c5hUMXydS18dx1Pamy3T2";
        String secretKey = "Y4TPUexitQhH9Y2-_0wwAqCcv8KYSoS9Uljh9KMd";
        String bucket = "hm-26";
        Auth auth = Auth.create(accessKey, secretKey);
        String uploadToken = auth.uploadToken(bucket);
        return uploadToken;
    }
}
